module render.abstractrenderer;

import utils.vector2;
import utils.color;

class AbstractRenderer {
    ///this gets called at least before first call to render(),
    ///but may be called while rendering an image
    ///Params:
    /// pixelSize = size of a pixel, note that the caller might want to render
    ///     a subpixel!
    /// validFrom, validTo = rectangle region of what will be rendered
    public abstract void initRender(Vector2f pixelSize, Vector2f validFrom,
        Vector2f validTo);

    /// returnvalue = valid render size
    public Vector2f renderSize(float outAr) {
        return Vector2f(1.0f, 1.0f);
    }

    ///will always be called after an initRender()
    ///is guaranteed to be called before another initRender()
    public void terminateRender() {
        //default: nop
    }

    public abstract RGBColor render(Vector2f pos);
}
